
import './App.css';

import React, { Component ,lazy,Suspense} from 'react';
// import Detail from "./views/Detial";
import { Switch, Route, Redirect} from "react-router-dom";

import Loading from './component/Loading';
var Detail=lazy(()=>import('./views/Detial'))
var Index=lazy(()=>import('./views/Index'))
var Search=lazy(()=>import('./component/Search'))
var GoodDetail=lazy(()=>import('./views/GoodDetail'))
var Colloction=lazy(()=>import('./views/Colloction'))
var Login=lazy(()=>import('./component/Login'))
var Register=lazy(()=>import('./component/Register'))
// import MyHeader from './component/MyHeader'
// import MyMain from './component/MyMain'

//底部
//  import MyTabbar from './component/MyTabbar'

// import Index from "./views/Index";
//分类页
// import MyCategory from "./component/MyCategory";

//登录页
// import  Login from "./component/Login";

//注册页
// import Request from "./component/Request";
class App extends Component {
  render() {
    return (
      <div className='app'>
        <div className='view'>
        <Suspense fallback={<Loading/>}>
          <Switch>
          <Route  path='/detail' component={Detail}></Route>
          <Route  path='/index' component={Index}></Route>
          <Route  path='/search' component={Search}></Route>
          <Route  path='/goodDetail' component={GoodDetail}></Route>
          <Route  path='/colloction' component={Colloction}></Route>
          <Route  path='/login' component={Login}></Route>
          <Route  path='/Register' component={Register}></Route>
          <Redirect from='/' to='/index'></Redirect>
          </Switch>
          </Suspense>

        </div>
        
        {/* <MyHeader />
     
       <MyMain></MyMain> */}
        {/*      分类页 */}
        {/* <MyCategory></MyCategory>*/}
          
        {/* <MyTabbar />  */}
{/* <Index></Index> */}
        {/* 登录页 */}
        
        {/* <Login></Login> */}

        {/* 注册页 */}

        {/* <Request></Request> */}
      
    
      </div>
    );
  }
}

export default App;


